<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UserController extends Controller
{
    public function login(Request $i) {
        $userName = $i->input('username');
        $password = $i->input('password');

        return $this->data(['token' => 'admin-token'])->json();
    }

    public function info(Request $i) {
        $token = $i->header('X-token');
        return $this->data([
            'name'      => '张维喜',
            'avatar'    => 'http://daxue.laohoulundao.com/images/index-img.png',
            'roles'     => ['admin']
        ])->json();
    }

    public function logout() {
        return $this->json();
    }
}
